import request from '@/utils/request'

export const login = data => {
    console.log(data.username)
    console.log(data.password)
    return request({
        method: 'get',
        url: '/wp-json/wp/v2/users/me?context=edit',
        // data 于data 一样简写
        auth:data
    })
}
//register
export const register = (auth,data) => {
    return request({
        method: 'POST',
        url: '/wp-json/wp/v2/users',
        auth,
        // data 于data 一样简写
        data
    })
}

export const getlist = (auth) => {
    return request({
        method: 'GET',
        url: '/wp-json/wp/v2/users',
        auth,
    })
}
export const deleteuserapi = (auth,data) => {
    return request({
        method: 'DELETE',
        url: `/wp-json/wp/v2/users/${data.id}`,
        auth,
        data
    })
}
export const getuserinfoapi = (auth,data) => {
    return request({
        method: 'GET',
        url: `/wp-json/wp/v2/users/${data.id}?context=edit`,
        auth,
    })
}
export const changeuserinfoapi = (auth,data) => {
    return request({
        method: 'PUT',
        url: `/wp-json/wp/v2/users/${data.id}`,
        auth,
        data
    })
}
